<?php

/**
 * Advantages filter form base class.
 *
 * @package    rpgcom
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseAdvantagesFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'size'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'speed'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'initiativeMod' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'defense'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'armor'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'health'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'willpower'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'morality'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hValue'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'wValue'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'size'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'speed'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'initiativeMod' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'defense'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'armor'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'health'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'willpower'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'morality'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'hValue'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'wValue'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('advantages_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Advantages';
  }

  public function getFields()
  {
    return array(
      'idAdvantages'  => 'Number',
      'size'          => 'Number',
      'speed'         => 'Number',
      'initiativeMod' => 'Number',
      'defense'       => 'Number',
      'armor'         => 'Number',
      'health'        => 'Number',
      'willpower'     => 'Number',
      'morality'      => 'Number',
      'hValue'        => 'Number',
      'wValue'        => 'Number',
    );
  }
}
